package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) throws IOException {
        String data;
        FileOutputStream fos = new FileOutputStream("note02.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        Scanner sc = new Scanner(System.in);
        data = sc.nextLine();
        while (!("exit".equals(data))){
            osw.write(data);
            System.out.println("输出完毕");
            data = sc.nextLine();
        }
        osw.close();
    }
}
